﻿<!DOCTYPE html>
<html>
<head>
    <title>济南希望儿童康复中心</title>
    <link rel="icon" href="/favico.ico" type="/image/x-icon" />
    <link rel="shortcut icon" href="/favico.ico" type="/image/x-icon" />

    <!--Import materialize.css-->
    <link type="text/css" rel="stylesheet" href="content/materialize-v0.97.0/css/materialize.min.css" media="screen,projection" />
    <link href="content/materialize-v0.97.0/css/icon.css" rel="stylesheet">

    <!--Let browser know website is optimized for mobile-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body ng-app="hhApp">
    <!--Import jQuery before materialize.js-->
    <script type="text/javascript" src="content/jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="content/angular-v1.4.1/angular.min.js"></script>
    <script type="text/javascript" src="content/angular-v1.4.1/angular-route.min.js"></script>
    <script type="text/javascript" src="content/materialize-v0.97.0/js/materialize.min.js"></script>
    <script type="text/javascript" src="res/js/hh.js"></script>
    <ng-include src="'templates/header.html'"></ng-include>
    <main>
        <div class="container">
            <blockquote>
                <h5>
                    当前位置:新闻中心
                </h5>
            </blockquote>
            <div class="row">
                <div class="col m9 s12">
                    <div ng-view>
                    </div>
                </div>
                <div class="col m3 s12" ng-controller="ALController">
                    <blockquote>
                        <h5>新闻动态</h5>
                    </blockquote>
                    <div ng-show="visible">
                        <div class="progress">
                            <div class="indeterminate"></div>
                        </div>
                        <div>{{Message}}</div>
                    </div>
                    <div class="collection z-depth-1" ng-hide="visible">
                        <a class="collection-item hoverable" href="{{Article.Link}}" ng-repeat="Article in Articles">
                            {{Article.Title}}
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <ng-include src="'templates/footer.html'"></ng-include>
    <script>
        var app = angular.module("hhApp", ['ngRoute']);
        app.config(['$routeProvider', function ($routeProvider) {
            $routeProvider
                .when('/news/:id', {
                    templateUrl: function ($routeParams) {
                        return '/articles/news/views/' + $routeParams.id + '.html';
                    }
                })
               .otherwise({
                   redirectTo: '/list'
               });
        }]);

        app.controller("navController", function ($scope, $location) {
            $scope.isActive = function (route) {
                return route == $location.path();
            }
        });

        app.controller("ALController", function ($scope, $http) {
            $scope.visible = true;
            $scope.Message = "加载中...";
            $http({
                url: "/Data/NewsList.html"
            }).success(function (data, status) {
                //$scope.status = status;
                $scope.Articles = data.Data;
                $scope.visible = false;
            }).error(function (data, status) {
                //$scope.data = data || "Request failed";
                $scope.Message = "加载出错";
            });
        });

    </script>
</body>

</html>
